-
Notifications
You must be signed in to change notification settings - Fork 275
fix(amazonq): lsp token/update emits for init, logins, and token refresh #5477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Qodana Community for JVM16 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at [email protected]
|
|
Overall looks good! Can you double check if this code path triggers bearer token refresh? |
| val qConnection = ToolkitConnectionManager.getInstance(project) | ||
| .activeConnectionForFeature(QConnection.getInstance()) | ||
| ?: return | ||
| if (newConnection?.id != qConnection.id) return | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking, but are we sure these lines are not duplicated? I think they already exist somewhere in CW
| (connection.getConnectionSettings() as? TokenConnectionSettings) | ||
| ?.tokenProvider | ||
| ?.delegate | ||
| ?.let { it as? BearerTokenProvider } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this to a util
| ?.let { it as? BearerTokenProvider } | ||
| ?.currentToken() | ||
| ?.accessToken | ||
| ?.let { token -> updateTokenCredentials(token, true) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add the var name before the boolean?
…esh (aws#5477) * emit on login * reorder * tests
…esh (aws#5477) * emit on login * reorder * tests
Added a listener and changed some of the init logic to better handle auth events for emitting the token to the LSP
Types of changes
Description
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.